{% extends 'ViettransFrontBundle::layout.html.twig' %}

{% block search %}
    {% render 'ViettransFrontBundle:Partial:search' with {'request':app.request} %}
{% endblock %}

{% block body %}
<div id="servicepro_index">
    <div id="servicepros">
        {% for i, servicepro in servicepros %}
			<div class="grid_12">
				<div class="servicepro {{ cycle(['even', 'odd'], i) }}">
					<div class="grid_12">
						<div class="name"><a title="{{ servicepro.name }}" href="{{ path('servicepro_show', {'id': servicepro.id}) }}">{{ servicepro.name }}</a></div>
						<div class="category_locality"><i>{{ servicepro.categoryObj.name }} / {{ servicepro.townObj.name }} ({{ servicepro.townObj.code }})</i></div>
					</div>
					<div class="clear"></div>
					<div class="grid_3">
						<div class="photo">
							<a title="{{ servicepro.name }}" href="{{ path('servicepro_show', {'id': servicepro.id}) }}"><img alt="photo" src="{{ asset(servicepro.photos != '' ?'images/servicepro/thumb/' ~ servicepro.photos ~ '.jpg' : 'images/servicepro/thumb/noThumb80x60.jpg') }}" /></a>
						</div>
					</div>
					<div class="clear"></div>
					<div class="grid_5">
						{% if servicepro.userId %}
							<div>Nguoi dung {{ servicepro.userObj.name }}</div>
						{% endif %}
					</div>
				</div>
			</div>
        {% else %}
            <div class="servicepro">
				<div class="error">Không tìm thấy kết quả nào tương ứng.</div>
            </div>
        {% endfor %}
    </div>
</div>

{% endblock %}